import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import javax.servlet.annotation.WebServlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.concurrent.Executor;

//// 这个操作表明 Tomcat收到的请求中，路径为 /hello 的请求才会调用HelloServlet这个类的代码
// 也就是说， webServlet 其实设置的是 一种条件，类似于触发时间的条件

@WebServlet("/hello")
public class HelloServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        System.out.println("hellosdafsdfsadf");
        resp.getWriter().write("helloasdfsdf");
    }
}








